-
-
Notifications
You must be signed in to change notification settings - Fork 195
London | Emmanuel Gessessew | Module-Structuring-and-Testing-Data | sprint 3| WEEK 3 #185
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
London | Emmanuel Gessessew | Module-Structuring-and-Testing-Data | sprint 3| WEEK 3 #185
Conversation
Sprint-3/implement/get-angle-type.js
Outdated
@@ -36,7 +36,7 @@ function getAngleType(angle) { | |||
} else if (angle < 90) { | |||
return "Acute angle"; | |||
// to get the obtuse angle | |||
} else if (angle > 90 && angle < 180) { | |||
} else if (90 < angle < 180) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this test case doesn't work - can you check what happens if you use the condition angle > 90 && angle < 180 instead of 90 < angle < 180, and explain why does one work and the other doesn't?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The condition 90 < angle < 180 doesn't work in JavaScript because it evaluates 90 < angle first, resulting in a boolean (true or false), which is then compared to 180. JavaScript do nott support chained comparisons like Python.
@@ -32,3 +32,14 @@ | |||
// target output: false | |||
// Explanation: The fraction 3/3 is not a proper fraction because the numerator is equal to the denominator. The function should return false. | |||
// These acceptance criteria cover a range of scenarios to ensure that the isProperFraction function handles both proper and improper fractions correctly and handles potential errors such as a zero denominator. | |||
|
|||
function isProperFraction(Numerator, Denominator ){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The isProperFraction function is implemented correctly based on the provided instructions. The function handles all specified cases, including proper fractions, improper fractions, zero denominators, negative fractions, and equal numerators and denominators.
the assertions, or a test javascript file is missing, could you provide one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i have provided one and push the changes.
if (Math.abs(Numerator) < Math.abs(Denominator)) { | ||
return true; | ||
} else if (Denominator === 0){ | ||
return "Error"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Zero Denominator Check: The current implementation returns the string "Error" when the denominator is zero. Instead, it should throw an error to properly handle this invalid case.
Order of Checks: The check for a zero denominator should be the first condition to ensure that invalid fractions are caught early.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i have made the changes thanks
since this PR was hanging around quit a lot (the label "needs review" wasn't assigned, and the PR listing tool didn't pick it up), i'm just going to mention that you'll need to brush up on your git knowledge (the PR contains commits for previous tasks as well; however i checked later PRs, and this issue doesn't seem to be there, so there was improvement in how you manage adherence to the requirement where each submitted task needed to be based on a newly cloned repository) |
i will add the complete label, considering the shortage of time / this needing to be finished |
Learners, PR Template
Self checklist
Changelist
Briefly explain your PR.
i performed TDD on the given tasks. test then implement
Questions
Ask any questions you have for your reviewer.